<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('修改员工')" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-post-edit" th:object="${personInfo}">
			<input id="infoId" name="infoId" type="hidden" th:field="*{infoId}"/>
			<div class="form-group">
				<label class="col-sm-3 control-label">公告名称：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="infoName" id="infoName" th:field="*{infoName}" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">性别：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="infoSex" id="infoSex" th:field="*{infoSex}" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">手机：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="infoPhone" id="infoPhone" th:field="*{infoPhone}" required>
				</div>
			</div>

			<div class="col-md-12">
				<div class="form-group">
					<label class="col-sm-3 control-label">部门名称</label>
					<div class="col-sm-8">
						<select class="form-control" name="deptId">
							<option th:each="personDept:${vos}" th:value="${personDept.deptId}"  th:selected="${personDept.deptId eq personInfo.deptId}">[[${personDept.deptName}]]</option>
						</select>

					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">岗位：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="infoPosition" id="infoPosition" th:field="*{infoPosition}" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">状态：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="infoStatus" id="infoStatus" th:field="*{infoStatus}" required>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label">备注：</label>
				<div class="col-sm-8">
					<textarea id="remark" name="remark" class="form-control">[[*{remark}]]</textarea>
				</div>
			</div>
		</form>
	</div>
	<th:block th:include="include :: footer" />
	<script type="text/javascript">
		var prefix = ctx + "person/info";
		
		$("#form-post-edit").validate({
			onkeyup: false,
			rules:{
				// postName:{
				// 	remote: {
		        //         url: prefix+ "/checkTypeNameUnique",
		        //         type: "post",
		        //         dataType: "json",
		        //         data: {
		        //         	"typeId": function() {
				// 			    return $("input[name='typeId']").val();
				// 			},
		        //         	"typeName" : function() {
		        //                 return $.common.trim($("#typeName").val());
		        //             }
		        //         },
		        //         dataFilter: function(data, type) {
		        //         	return $.validate.unique(data);
		        //         }
		        //     }
				// },

				infoId:{
					digits:true
				}
			},
			// messages: {
			//
		    //     "typeName": {
		    //         remote: "公告名称已经存在"
		    //     }
		    // },
		    focusCleanup: true
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	        	$.operate.save(prefix + "/edit", $('#form-post-edit').serialize());
	        }
	    }
	</script>
</body>
</html>
